class RmigrationsController < ApplicationController
  # GET /rmigrations
  # GET /rmigrations.xml
  def index
    @rmigrations = Rmigration.find(:all)

    respond_to do |format|
      format.html # index.rhtml
      format.xml  { render :xml => @rmigrations.to_xml }
    end
  end

  # GET /rmigrations/1
  # GET /rmigrations/1.xml
  def show
    @rmigration = Rmigration.find(params[:id])

    respond_to do |format|
      format.html # show.rhtml
      format.xml  { render :xml => @rmigration.to_xml }
    end
  end

  # GET /rmigrations/new
  def new
    @rmigration = Rmigration.new
  end

  # GET /rmigrations/1;edit
  def edit
    @rmigration = Rmigration.find(params[:id])
  end

  # POST /rmigrations
  # POST /rmigrations.xml
  def create
    @rmigration = Rmigration.new(params[:rmigration])

    respond_to do |format|
      if @rmigration.save
        flash[:notice] = 'Rmigration was successfully created.'
        format.html { redirect_to rmigration_url(@rmigration) }
        format.xml  { head :created, :location => rmigration_url(@rmigration) }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @rmigration.errors.to_xml }
      end
    end
  end

  # PUT /rmigrations/1
  # PUT /rmigrations/1.xml
  def update
    @rmigration = Rmigration.find(params[:id])

    respond_to do |format|
      if @rmigration.update_attributes(params[:rmigration])
        flash[:notice] = 'Rmigration was successfully updated.'
        format.html { redirect_to rmigration_url(@rmigration) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @rmigration.errors.to_xml }
      end
    end
  end

  # DELETE /rmigrations/1
  # DELETE /rmigrations/1.xml
  def destroy
    @rmigration = Rmigration.find(params[:id])
    @rmigration.destroy

    respond_to do |format|
      format.html { redirect_to rmigrations_url }
      format.xml  { head :ok }
    end
  end
end
